package com.steel.yfmall.cloud.assistant.po.view;


import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author jia chang bao
 * @date 2020/11/11 17:29
 */
public class ByProductPriceBeanZgConditionExample {

    /**
     * 创建一个查询条件:zg_city_code
     *
     * @return 返回类型 Criteria
     * @Title: createCriteria
     * @Description: (创建一个查询条件)
     * @date 2020-11-04 13:57:04
     */
    public Criteria createCriteria() {
        Criteria criteria = new Criteria();
        return criteria;
    }


    /**
     * @author 18304
     * @version 1.0
     * @title zg_city_code表的实体类
     * @description zg_city_code
     * @date 2020-11-04 13:57:04
     */
    protected abstract static class GeneratedCriteria implements java.io.Serializable {

        protected Map<String, Map<String, Object>> condition = new HashMap<>();

        public Map<String, Map<String, Object>> getCondition() {
            return condition;
        }

        public Criteria andByProdPriceNoEqualTo(String value){
            Map<String, Object> map = new HashMap<>();
            map.put("CONDITION", "eq");
            map.put("VALUE", value);
            condition.put("byprodpriceno", map);
            return (Criteria) this;
        }

        public Criteria andByProdPriceNoIn(List<String> value) {
            //去除前后中括号
            String strip = StringUtils.strip(value.toString(), "[]");
            //去除空格
            String str = strip.replaceAll("(?:\\[|null|\\]| +)", "");
            Map<String, Object> map = new HashMap<>();
            map.put("CONDITION", "in");
            map.put("VALUE", str);
            condition.put("ByProdPriceNo", map);
            return (Criteria) this;
        }

        public Criteria andCustNoEqualTo(String value) {
            Map<String, Object> map = new HashMap<>();
            map.put("CONDITION", "eq");
            map.put("VALUE", value);
            condition.put("CustNo", map);
            return (Criteria) this;
        }

        public Criteria andRecorderNoLike(String value) {
            Map<String, Object> map = new HashMap<>();
            map.put("CONDITION", "likeEnd");
            map.put("VALUE", value);
            condition.put("RecorderNo", map);
            return (Criteria) this;
        }

        public Criteria andCreateDateLess(String value) {
            Map<String, Object> map = new HashMap<>();
            map.put("CONDITION", "less");
            map.put("VALUE", value);
            condition.put("CreateDate", map);
            return (Criteria) this;
        }

        public Criteria andCreateDateGreat(String value) {
            Map<String, Object> map = new HashMap<>();
            map.put("CONDITION", "great");
            map.put("VALUE", value);
            condition.put("CreateDate", map);
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

}
